package com.example.qt.ptplatform.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.qt.ptplatform.entity.CommentLike;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface CommentLikeMapper extends BaseMapper<CommentLike> {
    @Select("SELECT COUNT(*) FROM comment_likes WHERE user_id = #{userId} AND comment_id = #{commentId}")
    int existsByUserAndComment(@Param("userId") Integer userId, @Param("commentId") Integer commentId);

    int deleteByCommentId(@Param("commentId") Integer commentId);
}